from langchain_community.chat_models.tongyi import ChatTongyi
from langchain_community.utilities import SQLDatabase
import os
import dashscope
import ast


db = SQLDatabase.from_uri(f"mysql+pymysql://root:200512@43.142.176.219:3306/teachplatform")

# 打印数据库方言
print(db.dialect)
# 打印可用的表名
print(db.get_usable_table_names())
# 打印表结构
print(db.get_table_info())